﻿var lastObj = null;
$(document).ready(function () {
    $(".lt0").mouseover(function () {
        $(this).attr("class", "lt1");
    });
    $(".lt0").mouseout(function () {
        $(this).attr("class", "lt0");
    });
    $(".lt0").click(function () {
        if (lastObj != null) {
            lastObj.css({ border: 'solid 1px #F1F1F1', background: "#F1F1F1" });
        }
        lastObj = $(this);
        $(this).css({ border: 'solid 1px #999', background: "#CCC" });
    });
    top.topwin_show();

});

var NodeID = UrlParm.parm('nodeid');
function doing(action, param) {
    switch (action) {
        case 'createContent': //添加内容
            createContent();
            break;
        case 'extrapublish_admin':            
            top.mainwin_Open("../node/NodeAddionalPub_list.aspx?nodeid=" + NodeID,1)
            break;
        case 'setting': //结点设置
            var url = encodeURI(window.location);            
            top.mainwin_Open("../node/Node_save.aspx?nodeid=" + NodeID + "&referer=" + url,1)
            break;
        case 'advanced_search': //高级
            alert("高级搜索功能尚未实现");
            //parent.mainFrame.location = "admin_publish.php?sId=427947e210647ea49a897721316693fc&o=content_list&type=main&NodeID=" + NodeID + "&State=" + param
            break;
        case 'view_index': //查看           
            window.open("../admin_extrapublish.aspx?ac=viewIndex&nodeid=" + NodeID, '')
            break;
        case 'edit_index':
            alert("编辑首页模板功能尚未实现");
            break;
        case 'edit_content_tpl':
            alert("编辑内容模板尚未实现");
            break;
        case 'edit_image_tpl':
            alert("编辑图片模板功能尚未实现");
            break;
        case 'refresh_index':
            //frames["contentlist"].location = 'admin_publish.aspx?ac=PubNode&nodeid=' + NodeID + '&refer=' + encodeURI('content_list.aspx?nodeid=' + NodeID);
            top.TaskRun(' publish/admin_taskanalysis.aspx?ac=RePubNode&nodeid=' + NodeID + '&t=' + Math.random(), 'RePubNode_' + NodeID);
            break;
        case 'refresh_view':
            parent.mainFrame.location = parent.mainFrame.location;
            break;
        case 'recycle_bin': //回收站
            top.mainwin_Open("recycle_bin.aspx?nodeid=" + NodeID,1)
            break;
        case 'syncContent'://信息同步
            top.mainwin_Open("../node/Node_syncContent.aspx?nodeid=" + NodeID, 1)
            break;
        default:           
            top.mainwin_Open("content_list.aspx?nodeid=" + NodeID,1)
            break;
    }
}

function createContent() {//添加内容
    var leftPos = (screen.availWidth - 800) / 2;
    var topPos = (screen.availHeight - 600) / 2;   
    window.open('admin_publish_eidt.aspx?ac=add&nodeid=' + NodeID);
}

function refreshWorkArea() {
    parent.mainFrame.location = parent.mainFrame.location;
}